%Plots the cross-currency basis for all five currencies
function fig_CIP_history(dateVecCIP2, CIPCalcsAll, optfig)

if optfig.plotfig == 1
    
    [fontname,dimension,lw,folder,color,style,marker,markersize,fontsize_tit,fontsize_ax,fontsize_lab,fontsize_leg] = fn_optfig(optfig);
    
    f0 = figure('Units','inches','Position',dimension);
    
    plot(dateVecCIP2,CIPCalcsAll(:,1)*10000,'Color',color{1},'LineStyle',style{1},'LineWidth',lw); hold on;
    plot(dateVecCIP2,CIPCalcsAll(:,2)*10000,'Color',color{3},'LineStyle',style{2},'LineWidth',lw); hold on;
    plot(dateVecCIP2,CIPCalcsAll(:,3)*10000,'Color',color{4},'LineStyle',style{3},'LineWidth',lw); hold on;
    plot(dateVecCIP2,CIPCalcsAll(:,4)*10000,'Color',color{5},'LineStyle',style{4},'LineWidth',lw); hold on;
    plot(dateVecCIP2,CIPCalcsAll(:,5)*10000,'Color',color{6},'LineStyle',style{5},'LineWidth',lw); hold on;
    
    dateaxis('x',2)
    xlabel('Date','interpreter','latex','FontSize',fontsize_ax,'FontName',fontname)
    ylabel('CIP Deviations (basis points)','interpreter','latex','FontSize',fontsize_ax,'FontName',fontname)
    title('Cross-Currency Bases', 'interpreter','latex','FontSize',fontsize_tit,'FontName',fontname)
    grid; axis tight; box off;
    legendCell = {'AUD', 'GBP', 'CAD', 'EUR', 'JPY'};
    legend(legendCell,'interpreter','latex','FontSize',fontsize_leg,'FontName',fontname,'Location','best')
    legend boxoff
    
end

name = '01_CCBHistoryByDay';
print(f0,'-depsc','-painters','-noui','-r600',[folder,name,'.eps'])

end